﻿using System;
using System.Collections.ObjectModel;

using SBPweb.PROvibe.Shared.Library.Base;
using SBPweb.PROvibe.Shared.Library.Components;

namespace SBPweb.PROvibe.Client.Core.Services.ConfigurationProvider
{

    partial class Module : IModule
    {

        #region Properties
        
        public ReadOnlyCollection<IControl> Controls
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public ReadOnlyCollection<IService> Services
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public ReadOnlyCollection<IService> PublicServices
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public Version Version
        {
            get
            {
                if (string.IsNullOrEmpty(VersionAsString))
                {
                    return null;
                }
                return System.Version.Parse(VersionAsString);
            }
        }

        #endregion

        #region Methods

        public int CompareTo(object obj)
        {
            return CompareTo(obj as INameable);
        }

        public int CompareTo(IIndexable other)
        {
            if (other == null)
            {
                return 0;
            }
            return this.Id.CompareTo(other.Id);
        }

        public int CompareTo(INameable other)
        {
            if (other == null)
            {
                return 0;
            }
            return this.Name.CompareTo(other.Name);
        }

        public int CompareTo(IVersionable other)
        {
            if (other == null)
            {
                return 0;
            }
            return this.Version.CompareTo(other.Version);
        }

        #endregion

    }

}